#include <iostream>
#include <stack>
using namespace std;
using ll = long long;
int main()
{
  ll cnt1 = 0,cnt2 = 0,cnt3 = 0,cnt4 = 0;
  for(int i = 1;i <= 2023;i++){
    stack<int> st;
    int t = i;
    while(t != 0){
      st.push(t%10);
      t /= 10;
    }
    while(!st.empty()){
      int a = st.top();    st.pop();
      if(a == 2){
        cnt1++;
        cnt3 += cnt2;
      }else if(a == 0){
        cnt2 += cnt1;
      }else if(a == 3){
        cnt4 += cnt3;
      }
    }
  }
  cout << cnt4 << endl;
  return 0;
}

#include <iostream>
#include <vector>
using namespace std;
int main(){
  cout << 947293 << endl;
          // 45946551368
          // 45946551813
}
// using ll = long long;
// bool check(ll x) {
// 	for (ll i = 2; i * i <= x; i++) {
// 		if (x % i == 0) return false;
// 	}
// 	return true;
// }
// vector<ll> rember;
// int main()
// {
// 	ll  right = 23333333333333;
// 	// ll right = 100;
// 	ll left = 2333;
// 	ll n = 2, ans = 0;
// 	while (n * n <= right) {
// 		if (check(n)) {
// 			rember.push_back(n);
// 		}
// 		n++;
// 	}
// 	int size = rember.size();
// 	int end = size - 1;
// 	int begin = 0;
// 	for (int i = 0; i < size; i++) {
// 		ll a = left - rember[i] * rember[i], b = right - rember[i] * rember[i];
// 		while (end > i && b < rember[end] * rember[end]) {
// 			end--;
// 		}
// 		begin = max(begin,i);
// 		while (begin < end && a > rember[begin] * rember[begin]) {
// 			begin++;
// 		}
// 		ans += (end - begin);
// 		// cout << rember[i] << ' ' << rember[begin] << ' ' << rember[end] << endl;
// 		if (i > end || begin > end) {
// 			break;
// 		}
// 	}
// 	cout << ans << endl;
// 	return 0;
// }
#include <iostream>
#include <unordered_map>
using namespace std;
using ll = long long;
int main()
{
  unordered_map<int,int> window;
  int n;  cin>>n;
  for(int i = 0;i < n;i++){
    int t;cin>>t;
    window[t]++;
  }
  ll cnt1 = 0,cnt2 = 0;
  for(auto & a : window){
    if(a.second == 1)
      cnt1++;
    else if(a.second > 2){
      cnt2 += a.second - 2;
    }
  }
  if(cnt1 >= cnt2) {
    cout << (cnt1 + cnt2)/2 << endl;
  }else{
    cout << cnt2 << endl;
  }
  return 0;
}
#include <iostream>
#include <vector>

using ll = long long;
using namespace std;
int a[100005],b[100005];
int main()
{
  ll cnt1 = 0,cnt2 = 0,pos1 = 0,pos2 = 0,ans = 0;
  int n,m;  cin>>n>>m;
  for(int i = 0;i < n;i++)cin>> a[i];
  for(int i = 0;i < m;i++)cin>> b[i];
  while(pos1 != n || pos2 != m){
    if(cnt1 == cnt2){
      cnt1 = a[pos1],cnt2 = b[pos2];
      pos1++,pos2++;
    }else if(cnt1 > cnt2){
      cnt2 += b[pos2];
      pos2++;
      ans++;
    }else{
      cnt1 += a[pos1];
      pos1++;
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
using ll = long long;
ll x[2003],y[2003];
bool check(int i ,int j,int k){
  int x1 = x[i] - x[j],x2 = x[j] - x[k];
  int y1 = y[i] - y[j],y2 = y[j] - y[k];
  if(x1 == 0 && x2 == 0) return false;
  if(y1 == 0 && y2 == 0) return false;
  if(x1*y2 == x2 * y1) return false;
  ll a = (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j])*(y[i] - y[j]);
  ll b = (x[i] - x[k]) * (x[i] - x[k]) + (y[i] - y[k])*(y[i] - y[k]);
  ll c = (x[k] - x[j]) * (x[k] - x[j]) + (y[k] - y[j])*(y[k] - y[j]);
  ll  qa = sqrt(a),qb = sqrt(b),qc = sqrt(c);
  // if(qa + qb + qc <= 2 * max(qa,max(qb,qc)))
  // {
  //   return false;
  // }
  // a + b > c
  // a + b + c > 2* c
  return a == b || b == c || a == c;
}
int main()
{
  int n;  cin>>n;
  int ans = 0;
  for(int i = 0;i < n;i++)  cin>> x[i] >> y[i];
  for(int i = 2;i < n;i++){
    for(int j = 1;j < i;j++){
      for(int k = 0;k < j;k++){
        if(check(i,j,k)){
          // cout << i << ' ' <<j <<' ' << k << endl;
          ans++;
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}